package com.chen.controller;

import com.chen.service.CardService;
import com.chen.service.UserService;
import com.chen.vo.Result;
import com.chen.vo.param.CardParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author:chenao
 * @DATE:2022/3/18 20:26
 */
@RestController
@RequestMapping("card")
public class CardController {

    @Autowired
    private CardService cardService;
    @Autowired
    private UserService userService;

    @PostMapping("list")
    public Result listCard(@RequestBody CardParam param){
        return cardService.listCard(param);
    }

    @PostMapping("buy")
    public Result buyCard(@RequestBody CardParam param){
        return cardService.buyCard(param);
    }
}
